package org.example.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    @GetMapping("/hello")
    public String hello(){
        return "hello,I am cloud-eureka-client8002-hello";
    }


    @GetMapping("/world")
    public String world(){
        if(Math.random()*2>1){
            throw new RuntimeException("a");
        }
        return "hello,I am cloud-eureka-client8002-world";
    }

    @GetMapping("/timeout")
    public String timeout() throws InterruptedException {
        Thread.sleep(3000);
        return "hello,I am cloud-eureka-client8002-timeout";
    }
}
